<%@page import="sedev.shopping.util.Paging"%>
<%@page import="sedev.shopping.entities.ListHinhThucDichVu"%>
<%@include file="../../../init.jsp" %>
<%@include file="../script.jsp" %>
<%
	ListHinhThucDichVu listdata = (ListHinhThucDichVu)request.getAttribute("listloaidichvu");
	Paging paging = (Paging)request.getAttribute("paging");
%>
<div class="menu-box">
	<%@include file="../menu.jsp" %>
</div>
<div id="content-box">
	<div class="padding">
	    <div id="toolbar-box">
	       <div class="t">
	           <div class="t">
	               <div class="t"></div>
	           </div>
	       </div>
	       <div class="m">
	           <div id="toolbar" class="toolbar">
	               <table class="toolbar">
	                   <tbody>
	                       <tr>
	                           <td id="toolbar-new" class="button">
	                               <a class="toolbar" href="<s:url action="postBusinessType"></s:url>">
	                                   <span title="New" class="icon-32-new"></span>
	                                       <liferay-ui:message key="label-add-new" />
	                               </a>
	                           </td>
	                       </tr>
	                   </tbody>
	               </table>
	           </div>
	           <div class="header icon-48-article">
	               <liferay-ui:message key="label-business-type-manager" />
	           </div>
	           <%
				Integer errorCode = (Integer)request.getAttribute("errorCode");
				if(errorCode!=null ){%>
					<dl id="system-message">
					    <%if(errorCode < 0){%>
					    <dd class="error message fade">
						    <ul>
						        <li><liferay-ui:message key="label-execute-error" /></li>
						    </ul>
						</dd>
						
					<%}else{%>
						<dd class="message message fade">
						    <ul>
						        <li><liferay-ui:message key="label-execute-success" /></li>
						    </ul>
						</dd>
					<%}%>
					</dl>
				<%}%>
	           <div class="clr"></div>
	       </div>
	       <div class="b">
	           <div class="b">
	               <div class="b"></div>
	           </div>
	       </div>
	    </div>
	    <div id="element-box">
	        <div class="t">
	           <div class="t">
	               <div class="t"></div>
	           </div>
	        </div>
	        <div class="m">
	            <table class="tbstyle">
	                <tr class="tbhead">
	                    <th nowrap="nowrap" class="center" width="3%">#</th>
	                    <th><a href="#"><liferay-ui:message key="label-business-type-name" /></a></th>
	                    <th nowrap="nowrap" class="center" width="5%"><a href="#"><liferay-ui:message key="label-id" /></a></th>
	                    <th nowrap="nowrap" class="center" width="5%"><a href="#"><liferay-ui:message key="label-remove" /></a></th>
	                </tr>
	                <%
	                if(listdata != null && listdata.size()>0){
	                	for(int index=0; index<listdata.size() ;++index){%>
						<tr>
						    <td align="center"><%=(index+1)%></td>
						    <td>
						    	<a href="<s:url action="editBusinessType"></s:url>&businesstypeid=<%=listdata.get(index).getId()%>">
						    		<%=listdata.get(index).getTen()%>
						    	</a>
						    </td>
						    <td align="center"><%=listdata.get(index).getId()%></td>
						    <td align="center">
						        <a href="javascript:void(0);" onclick="shopping.removeItem('adminform',<%=listdata.get(index).getId()%>,'<liferay-ui:message key="label-message-delete" />')">
						            <img alt="<liferay-ui:message key="label-remove" />"  src="<%= request.getContextPath()%>/image/admin/icon-32-remove.jpg" width="16" height="16" border="0"/>
						        </a>
						    </td>
						</tr>
	                	<%}
	                }
	                %>
	            </table>
	            <%if(paging != null){%>
	            <div id="paging" style="display:none; text-align:center; margin-top:5px">
					{"currentPage":"<%=paging.getCurrent() %>"
					,"pageSize":"<%=paging.getPageSize() %>"
					,"totalRecord":"<%=paging.getTotalRecord() %>"
					,"numDisplay":"<%=paging.getNumDisplay() %>"
					,"action":"<s:url action="businessType"></s:url>"}
				</div>
				<script type="text/javascript">
					shopping.renderPaging("paging");
				</script>
				<%} %>
	            <form action="<s:url action="delBusinessType"></s:url>" method="post" id="adminform" name="adminform">
	                <input id="id" name="id" type="hidden" value=""/>
	            </form>
	        </div>
	        <div class="b">
	           <div class="b">
	               <div class="b"></div>
	           </div>
	        </div>
	    </div>
	</div>
</div>